#顺序结构 -- 基石
#循环结构
#分支结构

# if 条件：
#    执行语句
# else:
#    执行语句

#if条件不一定需要配套else

#三元运算
# a,b = 10, 20
# max = a if a>b else b
# import math
#
# a = int(input("请输入数值："))
# print(pow(a, 2) if a % 2 == 0 else math.sqrt(a))

# str1 = input("please input a string:")
# if str1.startswith("x"):
#     if len(str1) > 8:
#         print("str1以x开头而且长度大于8")
#     else:
#         print("str1以x开头，长度小于等于8")
# else:
#     print("str1不以为x开头")

#循环
# for i in range(10):
#     if i == 2:
#         continue #结束本次循环
#     print("*"*i)
#     print(i)
#     if i == 5:
#         break #终止循环
# else:
#     print("end.....") #for循环可以加else，循环体正常退出，执行else内容


# for i in 'abc':
#     for j in range(3):
#         print(i,j)

# for i in range(1, 10):
#     for j in range(1, i+1):
#         print(f"{j}*{i}={i*j}", end=" ")
#     print()

#while 循环
#while 条件为真：    可以接break与continue
# 循环语句体
# count = 0
# while count < 5:
#     print(count)
#     count += 1
# else:       #循环语句体全部执行完了，正常退出
#     print("end...")

# str1 = ""
# while str1 != "q":
#     str1 = input("please input an str:")
#     print(str1)

a = 10
num = int(input("请输入数值："))
if type(num) == int:
    for i in range(1, 3):
        if num == a:
            print(f"第{i}次猜对了")
            break
        elif num > a:
            print("猜大了")
            num = int(input("请输入数值："))
        else:
            print("猜小了")
            num = int(input("请输入数值："))
